import java.io.*;

public class Main {
    public static void main(String[] args) {
        File f = new File("Score.txt");
        Reader r = null;
        try {
            r = new FileReader(f);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        if(r != null){
            BufferedReader bf = new BufferedReader(r);
            try {
                String line = bf.readLine();
                //System.out.println(line);
                while ((line = bf.readLine())!=null){
                    String [] strs = line.split("#");
                    int cnt = 0;
                    int totalScore = 0;
                    for (String str : strs){
                        //System.out.println(str);
                        if(cnt == 0){
                            cnt++;
                            continue;
                        }else {
                            totalScore += Integer.parseInt(str);
                        }
                    }
                    System.out.println(totalScore);
                }
            }catch (IOException e){
                e.printStackTrace();
            }

        }
    }
}